package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class HistoryRequest extends BaseTokenRequest {

    public static final String PATH = BaseRequest.PATH + "api/load_old_mulitmediadiaries";

    private int babyID;

    private long createTS;

    private int length;

    private int type;

    public int getBabyID() {
        return babyID;
    }

    public void setBabyID(int babyID) {
        this.babyID = babyID;
    }

    public long getCreateTS() {
        return createTS;
    }

    public void setCreateTS(long createTS) {
        this.createTS = createTS;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        HistoryRequestBody body = new HistoryRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setBabyID(getBabyID());
        body.setCreateTS(getCreateTS());
        body.setLength(getLength());
        body.setType(getType());
        return body;
    }

    private class HistoryRequestBody extends BaseTokenRequestBody {

        @SerializedName("BabyID")
        private int babyID;

        @SerializedName("LocalTS")
        private long createTS;

        @SerializedName("PageSize")
        private int length;

        @SerializedName("diarytype")
        private int type;

        public int getBabyID() {
            return babyID;
        }

        public void setBabyID(int babyID) {
            this.babyID = babyID;
        }

        public long getCreateTS() {
            return createTS;
        }

        public void setCreateTS(long createTS) {
            this.createTS = createTS;
        }

        public int getLength() {
            return length;
        }

        public void setLength(int length) {
            this.length = length;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public HistoryRequestBody() {
            setSv(BaseRequestConfig.SV_HISTORY_MEDIA_GET);
        }
    }

}
